package com.xnyzc.lhy.task.task.punishment;

import com.xnyzc.lhy.task.fegin.punishment.QuartzPunishmentStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: cuichaoqun
 * @Date: 2019-11-09
 * @Description 司机处罚解封解冻相关
 */

@Slf4j
@Component("quartzPunishmentStatistics")
public class QuartzPunishmentStatistics {
    @Autowired
    private QuartzPunishmentStatisticsService  quartzPunishmentStatisticsService;

    /**
     * 自动处理司机处罚解封
     * 每天凌晨1点执行一次
     */
    //@Scheduled(cron = "0 0 1 * * ?")
    @Scheduled(cron = "0 */5 * * * ?")
    public void unsealDriverPenaltyTask() {

        log.info("===========开始处理司机处罚解封==========");
        quartzPunishmentStatisticsService.unsealDriverPenaltyTask();
        log.info("===========结束处理司机处罚解封===========");

    }

    /**
     * 自动处理司机处罚解冻
     * 每天凌晨1点执行一次
     */
    //@Scheduled(cron = "0 0 1 * * ?")
    @Scheduled(cron = "0 */5 * * * ?")
    public void unsealDriverThawTask() {

        log.info("===========开始处理司机处罚解冻==========");
        quartzPunishmentStatisticsService.unsealDriverThawTask();
        log.info("===========结束处理司机处罚解冻===========");

    }

}
